package electricalequipment;

import java.util.ArrayList;

/**
 * @author: zh
 * @date: 2021/12/15 20:58
 * @version: 1.0
 */
public class Zh0202Composite extends Zh0202ElectricalEquipment {
    private ArrayList<Zh0202ElectricalEquipment> list = new ArrayList();
    @Override
    public void open() {
        for (Zh0202ElectricalEquipment equipment : list) {
            equipment.open();
        }
    }

    @Override
    public void close() {
        for (Zh0202ElectricalEquipment equipment : list) {
            equipment.close();
        }
    }

    @Override
    public void add(Zh0202ElectricalEquipment equipment) {
        list.add(equipment);
    }

    @Override
    public void remove(Zh0202ElectricalEquipment equipment) {
        list.remove(equipment);
    }
}
